home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Bus / Calendar / Tide Calendar 2.5 Demo.sit / TC2.5 Doc (text) / TC2.5 Doc (text)
Encoding:
Text File  |  1995-03-23  |  17.2 KB  |  215 lines  |  [TEXT/ttxt]

  1.       
  2. Tide Calendar 2.5
  3.  
  4. Proteus Software
  5. March 23, 1995
  6.  
  7.  
  8. 1. Introduction
  9.  
  10. The prediction of tides is important to anyone involved in coastal ocean activities such as surfing, diving, fishing, or boating.  A calendar is a convenient way of presenting the tide information on a day-to-day basis.  It is easy to quickly see the general magnitude and times of the tide extremes.  The Tide Calendar Program will calculate ocean tide heights from 1990 through the year 2025 for coastal stations in the continental United States, Alaska, and Hawaii, or Mexico.  The tide curve is calculated hourly for a complete month and displayed on a calendar grid.  The calendar also shows the times of sunrise and sunset on the first and last day of the month, the quarterly phases of the moon, and the times of the solstice or equinox if they occur.  In addition, a file containing the hourly tide heights, or the times of high and low tides can be created.
  11.  
  12. The predictions for the Mexico stations in this version of the program are sometimes less accurate.  Often, these predictions are based on a slightly different set of constituents than are normally used by the National Ocean Survey for US stations (and used by the Tide Calendar program).  In some cases, values of particular minor constituents have been approximated.  Additional constituent factors may be included in later versions of the program.
  13.  
  14. This program will run on all Macintosh computers Mac Plus or above, using system software 6.07 or greater.  A floating point processor is not required.  The FP version was compiled for machines capable of 68020 and 68881 instructions.  On such computers, this code will run significantly faster.  The FP version is not compatible with the Power PC Macintosh.
  15.  
  16.  
  17. 2. Program Operation
  18.  
  19. The use of this program is quite straight forward.  The desired geographical region is chosen from the Region Menu  and a particular station is chosen from the Station Menu.  A map showing the location of all the stations in the given set can be displayed.  The Options... selection in the Calendar Menu is used to set the vertical scale for the tide curves and the dimensions and appearance of the calendar.
  20.  
  21.  
  22. • File Menu
  23.  
  24. Save Highs & Lows
  25.     
  26.     This menu option is activated if a calendar has been created.  The times and heights of high and low tides for each day in the selected month are written to a disk file.  A dialog box is presented for the name of a file.
  27.  
  28. Save Hourly Tide Heights
  29.     
  30.     This menu option is activated if a calendar has been created.  The tide height at each hour in the selected month is written to a disk file.   The time in hours is given relative to the start of the month.  A dialog box is presented for the name of a file.
  31.  
  32. Page Setup...
  33.     
  34.     The usual dialog to set the printing conditions.  The height and width of the calendar must be consistent with the paper dimensions of the printer and the orientation of the page.
  35.  
  36. Print Calendar
  37.  
  38.     The usual dialog to start printing.  The calendar is a complex data structure and the printing can be time consuming.
  39.  
  40. Print Multiple...
  41.  
  42.     A dialog is presented for the first and last months to be printed.  The specified station, year, and all the options specified in the Options... dialog will be used.  A standard print dialog is presented and the monthly calendars are then calculated in sequence and sent to the printer.  This may take several minutes and it is strongly suggested that one month be printed first to verify that all settings are correct.
  43.  
  44. Quit
  45.  
  46.     Quit the program.  This is also achieved by closing the main window.
  47.  
  48. • Edit Menu
  49.  
  50. Copy
  51.     
  52.     The calendar can be copied into the clipboard and then pasted into a paint or draw type of program.
  53.  
  54. • Region Menu
  55.  
  56. Region
  57.  
  58.     The regions exist as resource files in the "Regions" folder which should be in the folder containing the Tide Calendar program.  A menu entry will be given for each resource file in this folder.  The standard geographical regions are West Coast, North East Coast, South East Coast, Gulf Coast, Alaska, Hawaii, and Mexico).  Each of these files contains the separate station resources (type 'stat') for that region.  The Station menu will be adjusted to show these stations and the appropriate map.  After selecting a new region, a particular station must then be selected to activate the Draw Calendar function.
  59.     New regions can be created and station resources can be moved between the region files using ResEdit.
  60.  
  61. • Station Menu
  62.     
  63. Map...
  64.  
  65.     A map of the geographical region is displayed which shows the locations of the stations.  The map is a rectangular projection and as the cursor is moved over the map, the latitude and longitude are displayed at the lower left of the window.  If the mouse is dragged with the button pressed, a rectangle is displayed and this part of the map can be expanded.  If the mouse button is pressed with the option-key down, the latitude and longitude coordinates are saved for use later.  This is designed to assist the user when the location of a new station is required (see below).
  66.  
  67. Add Current Station...
  68.  
  69.     This is useful method for creating a new station to reflect local conditions if a constant time shift and/or scale factor relative to a reference station are known.  The National Ocean Survey publishes tables which give these constants for many locations.  Sometimes these corrections are given separately for high and low water.  If this is the case, an average value must be used, since there is no way to analytically apply separate corrections to the tide curve.
  70.     The menu selection is activated if a (reference) station has been modified with a time offset or amplitude scale factor from the options menu.  A new station can then be created with the permanently altered constituents.  Latitude and longitude coordinates are entered for the desired location or pasted from values stored from the map window (see above).  The map coordinates are approximate and it is preferable to enter the exact coordinates if known.  The user is prompted for a station name and a comment string of up to 63 characters.  Do not use a '(' character in the name string since this will disable the menu selection.  The time zone is assumed to be the same as the reference station which is most likely correct, although not necessarily!  The new station is then added as a resource to the program and the name will appear in the Station menu and the map display.  The name will be displayed at the bottom right of the calendar.  The comments will be displayed at the bottom left corner of the calendar if the 'display comments' box from the calendar options is checked.
  71.  
  72. Add New Station...
  73.  
  74.     This is another method for creating a new station to reflect local conditions.  Latitude and longitude coordinates are entered for the desired location and tidal constituents are determined from a linear interpolation between existing (reference) stations.  This approximation is appropriate when the coastal path between the three locations is relatively straight and unobstructed.  The coordinates can also be pasted from values stored from the map window (see above).  The map coordinates are approximate and it is preferable to enter the exact coordinates if known. The algorithm for calculating the value of constituent Z at location X in terms of the distances projected on the straight line connecting stations A and B, is
  75.  
  76.     ZX = F(ZA dXB + ZB dXA,dAB ) .
  77.  
  78.  
  79.  
  80.  
  81. The two closest existing stations will be determined, if desired.  In any case, the user is free to directly enter the names of either reference station.  For this purpose, it is convenient to have the map window displayed and positioned relative to the dialog box so that station names are visible.
  82.     <Important> Often the two closest stations are not the 'best' choices for the interpolation.  This is apparent in the following figure.
  83.  
  84.  
  85.  
  86. Stations A and C are geographically closer to X than station B, however since the distance from either A or C to X is much larger than the distance A to C, the extrapolated (in this case) constituent values would be very sensitive to small variations in the constituents between A and C.  Interpolation based on stations A and B would probably give a better approximation to the tide curve at X.  If two valid station names are entered, the interpolation button is activated.  If selected, a window is opened and the constituent factors for the reference stations and the interpolated values are shown.  Z0 is the datum or average water height above mean lower low tide, etc.  All calculated negative values are clipped to zero since they must be positive.  The mouse button is clicked once and the phases from 0 to 360 degrees are shown.  Another click and the user is prompted for a station name and a comment string of up to 63 characters.  Do not use a '(' character in the name string since this will disable the menu selection.  The time zone is assumed to be the same as the closest reference station which is most likely correct, although not necessarily!  The new station is then added as a resource to the program and will appear in the Station menu and the map display.  The name will appear at the bottom right of the calendar and the comments will be displayed at the bottom left corner of the calendar if the 'display comments' box from the calendar options is checked.
  87.  
  88. Remove Station...
  89.     
  90.     The specified station resource will be permanently removed from the region's resource file.  This allows the user to practice adding stations using either of the above methods and avoid accumulating everything in the station list.  ResEdit can also be used to remove stations - or to add stations.  The station resources appear as type 'stat'.
  91.  
  92. Station Information...
  93.     
  94.     A window is opened and the station information is shown.  The tidal constituents, amplitudes (in feet) and phases (in degrees) are also shown.  Z0 is the datum or average water height above mean lower low tide, etc.  The mouse button is clicked to exit. 
  95.  
  96. Tide Station
  97.     
  98.     Specifies the station with the appropriate tidal constants for the tide curve calculation.  The latitude and longitude of the station are used for the astronomical calculations.
  99.  
  100.  
  101. • Month Menu
  102.  
  103. Month
  104.     
  105.     The calendar month.  Set to the current month at start up.
  106.  
  107.  
  108.  
  109. • Year Menu
  110.  
  111. Year
  112.     
  113.     Specifies the year in the range 1990 - 2025.
  114.  
  115. The program initially is configured with data for 1990 to 2025, however individual year resources can be added or removed from the menu list using ResEdit.  The data in these resources is used to make small corrections in the station data for variations in the moon's orbit.  The corrections are common to all stations.  A separate resource file named 'Year1901.rsrc' is included on the program disk and contains 125 individual resources for each year from 1901 to 2025.  If, for example, someone wanted to look at tide data for 1944, this data is available.  Open the 'Year' resources in 'Year1901.rsrc' using ResEdit and copy '1944'.  Then open the 'Year' resources in Tide Calendar and paste the data in.  The 'Year' resources do not need to be in a contiguous sequence.
  116.  
  117.  
  118. • Calendar Menu
  119.  
  120. Draw Calendar
  121.     
  122.     Draw the calendar and calculated tide curve for the specified station and month using the current values from the Options... dialog (see below).
  123.  
  124. Fit to Window
  125.  
  126.     Changes the display of the calendar in the window.  The calendar is either drawn to fit the window or at the size specified in the Options... dialog box.  This can be changed by checking or unchecking this option.  In either case, the printed calendar will have the dimensions specified.
  127.  
  128. Options...
  129.  
  130.     This dialog box allows the user to control the size and appearance of the calendar.  These options are saved as a resource and are used the next time the program is run.  The height and width of the outside calendar frame are specified in inches.  The calendar will be printed at the highest resolution of the chosen printer and variable line thicknesses can be specified for the calendar frame, the tide curve, and the grid scale.  The thickness is entered as a percentage of a screen pixel unit (1/72 inch).  For example, when printing to a 300 dot-per-inch laser writer,  ~25% increments can be used.  The program sets a minimum thickness of one pixel for all lines and therefore variations of less than 100% (or between increments of 100%) will not be evident on the screen.
  131.     The tide scale units can be either feet or meters.  The vertical scale of the tide curve is set by entering the minimum, maximum, and increment in the chosen units.  After some trial and error, appropriate values can be determined, depending on the preferences of the user.  For a particular station, these values will not need to be changed from month to month.  If the Auto box is checked, the calendar will be initially drawn with the current scale settings, then reasonable values will be calculated so that the tide curve fits well inside the calendar grid.  If these new values are different from the current settings, the current settings will be updated and the calendar will be re-drawn with these scale settings. 
  132.     The user can specify if the times and values of the maximum and minimum tide heights should be calculated and displayed below the day boxes.  With the initial font settings, the calendar width should be at least ~7 inches to give adequate room for these.  Daylight savings time can be incorporated in the tide curve and astronomical calculations if desired.  The tide curve will then be shifted one hour ahead from the first Sunday in April at 2:00 AM until the last Sunday in October at 2:00 AM.  The output in the written files is similarly affected.
  133.     A provision has been made to allow the user to arbitrarily shift the time of the tide curve and/or scale the tide amplitude relative to values for the selected reference station.  This is useful if it is desired to fine tune the calendar to local conditions.  The default values, used whenever a new reference station is chosen, are 0 minute shift and scale factor of 1.0.  If these are changed, the corrections are noted at the bottom of the calendar and also at the head of any written files. 
  134.       If the box Draw Calendar at Start-Up is checked, the calendar for the current station, month and year will indeed be drawn automatically when the program is run.
  135.     The times of sunrise and sunset are based on the latitude and longitude of the station.  The time is calculated when the sun center is 90˚ 50' from the zenith and the upper limb of the sun just crosses the apparent horizon.  This angle includes 16' for the sun's radius and 34' for the effects of atmospheric refraction.  These times can be displayed on the first and last days of the month, every Sunday, or every day of the month.
  136.  
  137.  
  138. 3. Calendar Text Appearance
  139.  
  140. The Tide Calendar program is initially configured to use Geneva 9,12,20, and 36 point and Helvetica 9 point fonts for the various text strings in the calendar.  For the best screen appearance, these fonts must exist in the system file.  The required fonts, sizes, and styles can be changed by modifying the 'Cldr' resource in the program.  This is easily done with ResEdit.  The 'Cldr' resource should initially look like the following.
  141.  
  142.      
  143.     
  144.  
  145. The entries that determine the text appearance are highlighted above.   Each entry consists of three consecutive 2-byte values for the font type, style, and point size.  Entries (in Hex) for the various text strings begin at the following locations.
  146.  
  147.     38    Month & Year
  148.     3D    Day of week
  149.     44    Day numbers
  150.     4A    -- not used --
  151.     50    Sunrise & Sunset times, Solstice, Equinox
  152.     56    Highs/Lows & times
  153.     5C    Station name
  154.     62    Tide scale
  155.  
  156. The possible font types include the following.
  157.  
  158.     systemFont    0x0000
  159.     applFont    0x0001
  160.     newYork    0x0002
  161.     geneva    0x0003
  162.     monaco    0x0004
  163.     venice    0x0005
  164.     london    0x0006
  165.     athens    0x0007
  166.     sanFran    0x0008
  167.     toronto    0x0009
  168.     cairo    0x000B
  169.     losAngeles    0x000C
  170.     times    0x0014
  171.     helvetica    0x0015
  172.     courier    0x0016
  173.  
  174. The possible style values are
  175.  
  176.     normal    0x0000
  177.     bold    0x0100
  178.     italic    0x0200
  179.     underline    0x0400
  180.     outline    0x0800
  181.     shadow    0x1000
  182.     condense    0x2000
  183.     extend    0x4000
  184.  
  185.  
  186.  
  187. 4. Further Information
  188.  
  189. Tidal curves are calculated from data supplied by the National Ocean Service.  The heights are given relative to the mean of the daily lower low tide.  The data consist of amplitudes and phases for up to 37 harmonic constituents whose frequencies are accurately determined from astronomical motions of the earth and moon relative to the sun.  These data are obtained from measurements of the sea level at a particular location or station over a long period of time.  The predicted tide height is generally accurate to within a few percent and the time of the tidal extreme should be accurate to within a few minutes.  The mathematical description can be found in many sources including the following.
  190.  
  191. Manual of Harmonic Analysis and Prediction of Tides
  192. Paul Schureman
  193. Special Publication No. 98
  194. U.S. Department of Commerce
  195. Coast and Geodetic Survey
  196.  
  197. Computer Applications to Tides in the National Ocean Survey
  198. U.S. Department of Commerce
  199. National Oceanic and Atmospheric Administration
  200. National Ocean Survey
  201.  
  202. These publications are available from:
  203.  
  204. National Ocean Service
  205. Tide and Current Predictions
  206. 1305 East West Hwy.
  207. Silver Springs, MD 20910
  208.  
  209.  
  210. Any questions, comments or suggestions are appreciated.  If there are bugs, please let me know.  Send e-mail to proteus@aol.com (America Online) or write to me at the address below. 
  211.  
  212.     Frank Hanson
  213.     4478 Marseilles Street
  214.     San Diego, CA 92107
  215.